<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<img id="imgs" src="img/1.jpg" ><br><br>
		<button id="btn" type="button" onclick="qiehuan()" style="margin-left: 15px;">切换图片</button>
	</body>
	
	
	<script type="text/javascript">
	var tupian=document.getElementById('imgs');
	var anniu=document.getElementById('btn');
	
	function qiehuan()
	{
		var myInerterval = setInterval(function(){
			var img_list=['./img/1.jpg','./img/2.jpg','./img/3.jpg','./img/4.jpg','./img/5.jpg','./img/6.jpg','./img/7.jpg','./img/8.jpg','./img/9.jpg','./img/10.jpg']
			var num=Math.floor(Math.random()*img_list.length);
			tupian.src=img_list[num];
		},300)
		
		
	}
	</script>
</html>
